import 'package:FlutterDemo/widget/scrollviews/helpers/helper_pageview.dart';
import 'package:flutter/material.dart';

/*
 * PageView 控件可以实现一个“图片轮播”的效果，PageView 不仅可以水平滑动也
    可以垂直滑动
 */
class SamplePageViewWidget extends StatefulWidget {
  const SamplePageViewWidget({Key? key}) : super(key: key);

  @override
  _SamplePageViewWidgetState createState() => _SamplePageViewWidgetState();
}

class _SamplePageViewWidgetState extends State<SamplePageViewWidget> {
  @override
  Widget build(BuildContext context) {
    // return Container(
    //   height: 200,
    //   child: PageView(
    //     children: [
    //       buildPageItem(Colors.primaries[0], 0),
    //       buildPageItem(Colors.primaries[1], 1),
    //       buildPageItem(Colors.primaries[2], 2),
    //       buildPageItem(Colors.primaries[3], 3),
    //       buildPageItem(Colors.primaries[4], 4)
    //     ],
    //   ),
    // );
    // return buildSamplePageView();
    return ListView(children: [
      Container(
        child: buildSamplePageView(),
      ),
      Container(
        child: buildImgListPageView(),
      ),
      Container(
        child: buildVerticalListPageView(),
      ),
      Container(
        child: buildSampleBanner(),
      )
    ]);
  }
}
